package com.direction.hold.ui;

import android.app.ProgressDialog;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.SubMenu;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import cn.cheln.explorer.actions.sort.DBSort;
import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.explorer.beans.FileUtil;
import cn.cheln.explorer.beans.MusicInfo;
import cn.cheln.explorer.config.Config;
import cn.cheln.explorer.ds.database.Category;
import cn.cheln.explorer.ds.database.CategoryInfo;
import cn.cheln.explorer.ds.database.MimeSrc;
import cn.cheln.explorer.ds.database.copersynch.DatasrcDelete;
import cn.cheln.explorer.ds.scan.ScanService;
import cn.cheln.explorer.ds.scan.ScanUpdateReceiver;
import cn.cheln.explorer.ds.uri.AccountNode;
import cn.cheln.explorer.ds.uri.NavigationConstants;
import cn.cheln.explorer.ds.uri.NavigationNode;
import cn.cheln.explorer.ds.uri.NavigationPool;
import cn.cheln.explorer.func.setup.PackageInstallManager;
import cn.cheln.explorer.ui.SearchListViewHolder;
import cn.cheln.explorer.ui.Switcher;
import cn.cheln.explorer.ui.ViewHolder;
import cn.cheln.explorer.util.Commit;
import cn.cheln.explorer.util.MusicBroadcastReceiver;
import cn.cheln.explorer.util.PackageReceiver;
import cn.cheln.explorer.util.ReadSystemMemory;
import cn.cheln.support.data.text.xml.SPUtil;
import cn.cheln.support.log.Logs;
import cn.cheln.support.mobile.sdcard.SDcardChecker;
import cn.cheln.support.mobile.sdcard.SDcardChecker.MediaScannerBroadcast;
import cn.cheln.support.ui.DensityUtil;
import cn.cheln.support.ui.adapter.MapAdapter;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;

public class CountActivity extends FileCursorActivity
{
  protected static final int MESS_LOAD_FINISH = 0;
  protected static final int MESS_SCAN_FINISH = 1;
  public static final int MESS_UPDATE_UI_COUNT = 2;
  public static CountActivity categoryActivity;
  boolean atTopToSearch = true;
  protected boolean bcurrentpage;
  private Map blockSizeMap;
  List<CategoryInfo> category = new ArrayList(0);
  protected AdapterView categoryAdaptView;
  protected Category categoryItem;
  boolean categoryVisitFlag;
  public int countSharedPrefernce = 0;
  Handler createHandler = new Handler()
  {
    public void handleMessage(Message paramMessage)
    {
      Boolean localBoolean;
      super.handleMessage(paramMessage);
      switch (paramMessage.what)
      {
      default:
      case 0:
      case 1:
      case 2:
      }
      do
      {
        do
        {
          return;
          ((CountActivity.HomeViewHolder)CountActivity.this.getViewHolderInstance()).notifyCountData(Boolean.valueOf(true));
          return;
          Commit.showDialog(CountActivity.this, "usedcount", 16, 100);
          return;
        }
        while ((Config.versioncode < 12) || (Config.versioncode > 13));
        localBoolean = (Boolean)SPUtil.getValue(CountActivity.this.context, "file", "tellaskexistornot", Boolean.class);
      }
      while ((localBoolean != null) && (localBoolean.booleanValue()));
      SPUtil.putValue(CountActivity.this.context, "file", "tellaskexistornot", Boolean.valueOf(true));
      CountActivity.this.context.showDialog(17);
    }
  };
  public boolean finishStarted;
  public boolean finished;
  protected MapAdapter homeAdapter;
  protected View homeView;
  public ViewHolder homeViewHolder;
  boolean isNoZero = false;
  protected Boolean launchFlag;
  private MusicBroadcastReceiver mbr;
  PackageReceiver packageReceiver;
  public ProgressDialog pd;
  protected TextView plusNumView;
  protected View progressbar_updown;
  protected Bundle savedInstanceState;
  private boolean scanBarToHideFlag = false;
  ScanUpdateReceiver scanUpdateReceiver;
  SharedPreferences sp;
  boolean startupFlag = false;
  protected TextView totalNumView;
  private View viewApk;
  private View viewAudio;
  private View viewDoc;
  private View viewImage;
  private View viewTheme;
  private View viewVideo;

  private void mediaScannerRefresh()
  {
    if (SDcardChecker.MediaScannerBroadcast.scanCat != null)
    {
      CommonActivity localCommonActivity3 = this.context;
      CommonActivity localCommonActivity4 = this.context;
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = SDcardChecker.MediaScannerBroadcast.scanCat;
      Toast.makeText(localCommonActivity3, localCommonActivity4.getString(2131034231, arrayOfObject2), 0).show();
    }
    do
    {
      return;
      categoryActivity.setScanBarHide(false);
      sendBroadcast(new Intent("android.intent.action.MEDIA_MOUNTED", Uri.parse("file://" + Environment.getExternalStorageDirectory())));
      SDcardChecker.mediaScanning = true;
    }
    while (categoryActivity.navTool.navEntity.size() == 0);
    SDcardChecker.MediaScannerBroadcast.scanCat = ((NavigationNode)categoryActivity.navTool.navEntity.peek()).displayname;
    CommonActivity localCommonActivity1 = this.context;
    CommonActivity localCommonActivity2 = this.context;
    Object[] arrayOfObject1 = new Object[1];
    arrayOfObject1[0] = SDcardChecker.MediaScannerBroadcast.scanCat;
    Toast.makeText(localCommonActivity1, localCommonActivity2.getString(2131034230, arrayOfObject1), 1).show();
  }

  public void access(NavigationNode paramNavigationNode, int paramInt1, boolean paramBoolean, int paramInt2, int paramInt3)
  {
  }

  public void access(NavigationNode paramNavigationNode, int paramInt1, boolean paramBoolean, int paramInt2, int paramInt3, int paramInt4)
  {
    access(paramNavigationNode, paramInt1, paramBoolean, paramInt2, paramInt3);
  }

  protected int addEmptyCategory(int paramInt1, int paramInt2, List<CategoryInfo> paramList)
  {
    Category localCategory = MimeSrc.getEmptyCategory(this, getString(paramInt1), getResources().getDrawable(paramInt2));
    localCategory.categoryInfo.count = 0;
    paramList.add(localCategory.categoryInfo);
    return 0;
  }

  protected boolean backward()
  {
    if ((!(this.navTool.isAtTop())) || (!(this.atTopToSearch)))
    {
      showBottomBar(8);
      if (this.atTopToSearch)
      {
        this.navTool.pop();
        showCreateHandler();
      }
      return true;
    }
    return false;
  }

  public void baseSwitchSearchMain(boolean paramBoolean)
  {
    if (paramBoolean);
    for (int i = 0; ; i = 1)
    {
      this.atTopToSearch = i;
      if (!(paramBoolean))
        break;
      LinearLayout.LayoutParams localLayoutParams = new LinearLayout.LayoutParams(-1, -2);
      ((LinearLayout)findViewById(2131230723)).setLayoutParams(localLayoutParams);
      findViewById(2131230726).setVisibility(0);
      return;
    }
    findViewById(2131230726).setVisibility(8);
    getWindow().getDecorView().invalidate();
  }

  public void callSuperStartup()
  {
    super.startup();
    ((SearchListViewHolder)getViewHolder(SearchActivity.class.getName())).init();
  }

  public void countData()
  {
    if ((MimeSrc.categoryRepository == null) || (MimeSrc.categoryRepository.isEmpty()))
    {
      initCount();
      initDBData(null);
    }
    MimeSrc.recountCategoryNum(this);
  }

  protected void cutOrCopy(int paramInt)
  {
    if (!(performCountActivityCopy(paramInt)))
      return;
  }

  public void enterDir(FileInfo paramFileInfo)
  {
    super.enterDir(paramFileInfo);
  }

  protected String getEmptyText()
  {
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = getString(2131034199);
    return getString(2131034118, arrayOfObject);
  }

  public int[] getMenuIds()
  {
    boolean bool = this.navTool.isAtTop();
    int[] arrayOfInt = null;
    if (!(bool))
    {
      arrayOfInt = new int[4];
      arrayOfInt[0] = 2131230902;
      arrayOfInt[1] = 2131230904;
      arrayOfInt[2] = 2131230903;
      arrayOfInt[3] = 2131230905;
    }
    return arrayOfInt;
  }

  public String getNavBarWholeShowText()
  {
    String str = "";
    int i = 0;
    if (i >= this.navTool.navEntity.size())
      label6: return str.substring(3);
    NavigationNode localNavigationNode = (NavigationNode)this.navTool.navEntity.get(i);
    if (localNavigationNode == null);
    while (true)
    {
      ++i;
      break label6:
      str = str + " / " + localNavigationNode.displayname;
    }
  }

  public View getPageView()
  {
    return this.homeView;
  }

  public ViewHolder getViewHolder()
  {
    return getViewHolder(CountActivity.class.getName());
  }

  public ViewHolder getViewHolderInstance()
  {
    if (this.homeViewHolder == null)
      this.homeViewHolder = getViewHolder(CountActivity.class.getName());
    return this.homeViewHolder;
  }

  public void handlerRead(Object paramObject, boolean paramBoolean)
  {
  }

  public void hideScanBar(int paramInt)
  {
    View localView = findViewById(2131230740);
    if (localView == null)
      return;
    localView.setVisibility(paramInt);
  }

  public List<CategoryInfo> initCount()
  {
    int j;
    label33: int k;
    label57: int l;
    label82: int i1;
    int i = 1;
    if (this.category.isEmpty())
    {
      if (addEmptyCategory(2131034153, 2130837547, this.category) != 0)
        break label141;
      j = i;
      this.isNoZero = j;
      if (addEmptyCategory(2131034155, 2130837549, this.category) != 0)
        break label146;
      k = i;
      this.isNoZero = k;
      if (addEmptyCategory(2131034154, 2130837582, this.category) != 0)
        break label151;
      l = i;
      this.isNoZero = l;
      if (addEmptyCategory(2131034156, 2130837517, this.category) != 0)
        break label157;
      i1 = i;
      label108: this.isNoZero = i1;
      if (addEmptyCategory(2131034157, 2130837505, this.category) != 0)
        break label163;
    }
    while (true)
    {
      this.isNoZero = i;
      return this.category;
      label141: j = 0;
      break label33:
      label146: k = 0;
      break label57:
      label151: l = 0;
      break label82:
      label157: i1 = 0;
      break label108:
      label163: i = 0;
    }
  }

  public void initDBData(String paramString)
  {
    this.category.clear();
    MimeSrc.initWholeCategories(this.context, paramString, this.category);
  }

  public boolean isInListDetail()
  {
    return (!(this.navTool.isAtTop()));
  }

  public ViewHolder loadCountViewHolder()
  {
    return loadViewHolder(CountActivity.class.getName(), new HomeViewHolder(this.homeView, this));
  }

  protected boolean navigate(MenuItem paramMenuItem)
  {
    Logs.i("", "---" + paramMenuItem.getTitle());
    int i = -100 + paramMenuItem.getItemId();
    if ((i < this.navTool.navEntity.size()) && (i == 0))
      backward();
    return false;
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.context = this;
    this.categoryVisitFlag = false;
    categoryActivity = this;
    getIntent().getAction();
    loadCountViewHolder();
    new Thread()
    {
      public void run()
      {
        super.run();
        if (CountActivity.this.scanUpdateReceiver == null)
        {
          CountActivity.this.scanUpdateReceiver = new ScanUpdateReceiver(CountActivity.this);
          IntentFilter localIntentFilter2 = new IntentFilter();
          localIntentFilter2.addAction("android.intent.action.MEDIA_SCANNER_FINISHED");
          localIntentFilter2.addAction("com.lewa.app.filemanager.receiveScanSignal");
          localIntentFilter2.addAction("com.lewa.app.filemanager.scanning");
          CountActivity.this.registerReceiver(CountActivity.this.scanUpdateReceiver, localIntentFilter2);
          CountActivity.this.mbr = new MusicBroadcastReceiver();
          IntentFilter localIntentFilter3 = new IntentFilter();
          localIntentFilter3.addAction("com.shortcut.music.metachanged");
          localIntentFilter3.addAction("com.shortcut.music.queuechanged");
          localIntentFilter3.addAction("com.shortcut.music.playbackcomplete");
          localIntentFilter3.addAction("com.shortcut.music.playstatechanged");
          CountActivity.this.registerReceiver(CountActivity.this.mbr, localIntentFilter3);
        }
        try
        {
          Thread.sleep(1900L);
          if (CountActivity.this.packageReceiver == null)
          {
            CountActivity.this.packageReceiver = new PackageReceiver(CountActivity.this);
            IntentFilter localIntentFilter1 = new IntentFilter();
            localIntentFilter1.addAction("android.intent.action.PACKAGE_ADDED");
            localIntentFilter1.addAction("android.intent.action.PACKAGE_REMOVED");
            localIntentFilter1.addDataScheme("package");
            CountActivity.this.registerReceiver(CountActivity.this.packageReceiver, localIntentFilter1);
            SDcardChecker.broadcastRec = new SDcardChecker.MediaScannerBroadcast();
            SDcardChecker.registerSDcardIntentListener(CountActivity.this, SDcardChecker.broadcastRec);
          }
          CountActivity.this.startService(new Intent(CountActivity.this, ScanService.class));
          return;
        }
        catch (InterruptedException localInterruptedException)
        {
          localInterruptedException.printStackTrace();
        }
      }
    }
    .start();
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    super.onCreateOptionsMenu(paramMenu);
    if (this.navTool.isAtTop())
      return false;
    paramMenu.clear();
    getMenuInflater().inflate(2131165184, paramMenu);
    paramMenu.removeItem(2131230906);
    setMenuItemById(paramMenu.findItem(2131230900).getSubMenu(), paramMenu.findItem(2131230900).getSubMenu().size());
    return true;
  }

  protected void onDestroy()
  {
    if (this.pd != null)
      this.pd.dismiss();
    this.pd = null;
    if (this.scanUpdateReceiver != null)
    {
      unregisterReceiver(this.scanUpdateReceiver);
      unregisterReceiver(this.packageReceiver);
      SDcardChecker.unregisterSDcardIntentListener(this, SDcardChecker.broadcastRec);
    }
    super.onDestroy();
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if ((paramInt == 82) && (this.navTool.isAtTop()))
      return true;
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  public boolean onMenuItemClick(MenuItem paramMenuItem)
  {
    return super.onMenuItemClick(paramMenuItem);
  }

  public boolean onMenuItemSelected(int paramInt, MenuItem paramMenuItem)
  {
    return super.onMenuItemSelected(paramInt, paramMenuItem);
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    return super.onOptionsItemSelected(paramMenuItem);
  }

  protected void onPause()
  {
    super.onPause();
  }

  public boolean onPrepareOptionsMenu(Menu paramMenu)
  {
    label69: SubMenu localSubMenu;
    MenuItem localMenuItem;
    if ((this.navTool.getCurrNavEntitySource() != null) && (this.navTool.getCurrNavEntitySource().toString().toLowerCase().equals("image")))
    {
      if (paramMenu.findItem(24) == null)
        paramMenu.add(0, 24, 0, getString(2131034282)).setIcon(2130837525);
      localSubMenu = paramMenu.findItem(2131230900).getSubMenu();
      if (!(((NavigationNode)this.navTool.navEntity.peek()).producingSource.toString().toUpperCase().equals("AUDIO")))
      {
        if ((this.sortMenuMarkInit == 0) || (this.sortMenuMarkInit == 1))
          paramMenu.findItem(2131230900).getSubMenu().findItem(2131230902).setChecked(true);
        localMenuItem = paramMenu.findItem(2131230900).getSubMenu().findItem(2131230905);
        if (!(((NavigationNode)this.navTool.navEntity.peek()).producingSource.equals("apk")))
          break label309;
      }
    }
    for (boolean bool = false; ; bool = true)
    {
      localMenuItem.setVisible(bool);
      hideMusicMenu(localSubMenu, false);
      return true;
      if ((this.navTool.getCurrNavEntitySource() != null) && (this.navTool.getCurrNavEntitySource().toString().toLowerCase().equals("audio")))
        setMenuItemById(paramMenu.findItem(2131230900).getSubMenu(), paramMenu.findItem(2131230900).getSubMenu().size());
      paramMenu.removeItem(24);
      label309: break label69:
    }
  }

  protected void onResume()
  {
    super.onResume();
    Logs.i("======== categoryVisitFlag " + this.categoryVisitFlag);
    if (this.categoryVisitFlag)
    {
      String str = (String)SPUtil.getValue(this.context, "ApkRememberedPage", "ISDELETED", String.class);
      if ((str != null) && (!(str.trim().equals(""))))
      {
        File localFile = new File(str);
        if (!(localFile.exists()))
        {
          DatasrcDelete.recursiveUpdateDel(new FileInfo(localFile, this.context), this.context);
          this.viewHolder.refresh();
        }
        SPUtil.putValue(this.context, "ApkRememberedPage", "ISDELETED", "");
      }
      Logs.i("======== categoryVisitFlag after " + this.categoryVisitFlag);
      return;
    }
    this.categoryVisitFlag = true;
  }

  public String prepareMime()
  {
    String str = ((NavigationNode)this.navTool.navEntity.peek()).producingSource.toString();
    if ((str.equals("doc")) || (str.equals("apk")) || (str.equals("audio")))
      return "*/*";
    return str + "/*";
  }

  protected void prepareMusicInfo(int paramInt, FileInfo paramFileInfo)
  {
    super.prepareMusicInfo(paramInt, paramFileInfo);
  }

  public void recovery()
  {
    if ((this.navTool.navEntity.isEmpty()) || (this.navTool.isAtTop()))
    {
      startup();
      return;
    }
    gotoCat();
    reFreshCheckboxVisible();
  }

  public void refresh()
  {
    if (SDcardChecker.srcardStateResolve(true, this));
    do
      return;
    while (!(this.atTopToSearch));
    if (this.navTool.isAtTop())
    {
      showCreateHandler();
      return;
    }
    loadFileCursor().refresh();
    reFreshCheckboxVisible();
  }

  public void refresh(boolean paramBoolean)
  {
    if (!(paramBoolean))
    {
      refresh();
      return;
    }
    if ((Config.isLewaRom) || (Category.intCat(((NavigationNode)this.navTool.navEntity.peek()).producingSource.toString().toLowerCase()) != -1))
    {
      mediaScannerRefresh();
      return;
    }
    Intent localIntent = new Intent(this, ScanService.class);
    localIntent.putExtra("scan_type", ((NavigationNode)this.navTool.navEntity.peek()).producingSource.toString());
    startService(localIntent);
  }

  public void searchAgain(FileInfo paramFileInfo)
  {
  }

  protected void setHiddenFileShowFlag()
  {
    this.isHiddenFileShow = Config.ACCOUNT_HIDE_OPTION;
  }

  protected void setNavigationPosAndNode(int paramInt1, int paramInt2, NavigationNode paramNavigationNode)
  {
    if ((paramInt2 != 0) || (this.navTool.navEntity.size() == 0))
      return;
    this.listview.setSelection(paramInt1);
  }

  public void setPageView(View paramView)
  {
    this.homeView = paramView;
  }

  public void setScanBarHide(boolean paramBoolean)
  {
    this.scanBarToHideFlag = paramBoolean;
  }

  public void setSort()
  {
    this.policy = new DBSort(0, 0);
  }

  protected void showApkViewContextMenux(ContextMenu paramContextMenu, ContextMenu.ContextMenuInfo paramContextMenuInfo)
  {
    paramContextMenu.setHeaderTitle(2131034267);
    paramContextMenu.add(0, 17, 0, 2131034286).setCheckable(false).setChecked(false).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener()
    {
      public boolean onMenuItemClick(MenuItem paramMenuItem)
      {
        if (PackageInstallManager.isInInstall)
        {
          Toast.makeText(CountActivity.this.context, 2131034290, 1).show();
          CountActivity.this.showBottomBar(8);
          return true;
        }
        CountActivity.this.showDialog(8);
        return false;
      }
    });
    paramContextMenu.add(0, 28, 0, 2131034200).setCheckable(false).setChecked(false).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener()
    {
      public boolean onMenuItemClick(MenuItem paramMenuItem)
      {
        CountActivity.this.send();
        return false;
      }
    });
  }

  public void showBottomBar(int paramInt)
  {
    boolean bool;
    if ((this.navTool.getCurrNavEntitySource() != null) && (this.navTool.getCurrNavEntitySource().toString().toLowerCase().equals("apk")))
      if (paramInt == 0)
      {
        bool = true;
        label38: switchApkBar(bool);
      }
    while (true)
    {
      super.showBottomBar(paramInt);
      return;
      bool = false;
      if (paramInt == 8);
      bool = false;
      break label38:
      switchApkBar(false);
    }
  }

  public void showCreateHandler()
  {
    new Thread()
    {
      public void run()
      {
        super.run();
        CountActivity.this.countData();
        Commit.ifShowCommitInvite(CountActivity.this, "usedcount", 100);
        CountActivity.this.createHandler.sendEmptyMessage(0);
        CountActivity.this.createHandler.sendEmptyMessage(1);
        CountActivity.this.createHandler.sendEmptyMessage(2);
      }
    }
    .start();
    Switcher.viewFlowTo(getViewHolder(CountActivity.class.getName()), this.contentView, this);
  }

  public void sort()
  {
    refresh();
  }

  public void startup()
  {
    if ((this.pd != null) && (!(this.pd.isShowing())))
      this.pd.show();
    new Thread()
    {
      public void run()
      {
        super.run();
        CountActivity.this.navTool.push(new AccountNode("", NavigationConstants.CATEGORYHOME));
        CountActivity.this.blockSizeMap = FileUtil.getAvailableStore(NavigationConstants.SDCARD_PATH);
        MusicInfo.init(CountActivity.this.context);
        Float localFloat = (Float)SPUtil.getValue(CountActivity.this.context, "SP_IMAGE_FILTER_SIZE", "KEY_IMAGE_FILTER_SIZE", Float.class);
        Config.image_filter_size = localFloat;
        if ((localFloat != null) && (localFloat.floatValue() != -1.0F))
          return;
        SPUtil.putValue(CountActivity.this.context, "SP_IMAGE_FILTER_SIZE", "KEY_IMAGE_FILTER_SIZE", Float.valueOf(-1.0F));
        Config.image_filter_size = Float.valueOf(-1.0F);
      }
    }
    .start();
    showCreateHandler();
  }

  public void switchApkBar(boolean paramBoolean)
  {
    if (this.bottomToolbar != null)
    {
      if (!(paramBoolean))
        break label70;
      this.bottomToolbar.findViewById(2131230829).setVisibility(8);
      this.bottomToolbar.findViewById(2131230828).setVisibility(8);
      this.bottomToolbar.findViewById(2131230835).setVisibility(0);
      this.bottomToolbar.findViewById(2131230834).setVisibility(0);
    }
    return;
    label70: this.bottomToolbar.findViewById(2131230829).setVisibility(0);
    this.bottomToolbar.findViewById(2131230828).setVisibility(0);
    this.bottomToolbar.findViewById(2131230835).setVisibility(8);
    this.bottomToolbar.findViewById(2131230834).setVisibility(8);
  }

  protected void swithToPrivacyActivity()
  {
  }

  protected void updateCountActivity(FileInfo paramFileInfo)
  {
    DatasrcDelete.recursiveUpdateDel(paramFileInfo, this);
    refresh();
  }

  public class HomeViewHolder extends ViewHolder
  {
    boolean inited;

    public HomeViewHolder(View paramView, CommonActivity paramCommonActivity)
    {
      super(paramView, paramCommonActivity);
    }

    private void bind_2_0(View paramView, CategoryInfo paramCategoryInfo)
    {
      Logs.i("----cateInfo" + paramCategoryInfo);
      ((TextView)paramView.findViewById(2131230759)).setText(FileUtil.addParentheses(paramCategoryInfo.count));
      ((TextView)paramView.findViewById(2131230760)).setText(paramCategoryInfo.size);
    }

    private void initUI()
    {
      CountActivity.this.viewAudio = CountActivity.this.findViewById(2131230728);
      ((ImageView)CountActivity.this.viewAudio.findViewById(2131230757)).setImageResource(2130837547);
      ((TextView)CountActivity.this.viewAudio.findViewById(2131230758)).setText(2131034153);
      ((TextView)CountActivity.this.viewAudio.findViewById(2131230759)).setText(FileUtil.addParentheses("  ?  "));
      ((TextView)CountActivity.this.viewAudio.findViewById(2131230760)).setText("0 B");
      CountActivity.this.viewAudio.findViewById(2131230756).setOnClickListener(CountActivity.this.categoryClickListener);
      CountActivity.this.viewImage = CountActivity.this.findViewById(2131230730);
      ((ImageView)CountActivity.this.viewImage.findViewById(2131230757)).setImageResource(2130837549);
      ((TextView)CountActivity.this.viewImage.findViewById(2131230758)).setText(2131034155);
      ((TextView)CountActivity.this.viewImage.findViewById(2131230759)).setText(FileUtil.addParentheses("  ?  "));
      ((TextView)CountActivity.this.viewImage.findViewById(2131230760)).setText("0 B");
      CountActivity.this.viewImage.findViewById(2131230756).setOnClickListener(CountActivity.this.categoryClickListener);
      CountActivity.this.viewVideo = CountActivity.this.findViewById(2131230731);
      ((ImageView)CountActivity.this.viewVideo.findViewById(2131230757)).setImageResource(2130837582);
      ((TextView)CountActivity.this.viewVideo.findViewById(2131230758)).setText(2131034154);
      ((TextView)CountActivity.this.viewVideo.findViewById(2131230759)).setText(FileUtil.addParentheses("  ?  "));
      ((TextView)CountActivity.this.viewVideo.findViewById(2131230760)).setText("0 B");
      CountActivity.this.viewVideo.findViewById(2131230756).setOnClickListener(CountActivity.this.categoryClickListener);
      CountActivity.this.viewDoc = CountActivity.this.findViewById(2131230732);
      ((ImageView)CountActivity.this.viewDoc.findViewById(2131230757)).setImageResource(2130837517);
      ((TextView)CountActivity.this.viewDoc.findViewById(2131230758)).setText(2131034156);
      ((TextView)CountActivity.this.viewDoc.findViewById(2131230759)).setText(FileUtil.addParentheses("  ?  "));
      ((TextView)CountActivity.this.viewDoc.findViewById(2131230760)).setText("0 B");
      CountActivity.this.viewDoc.findViewById(2131230756).setOnClickListener(CountActivity.this.categoryClickListener);
      CountActivity.this.viewApk = CountActivity.this.findViewById(2131230733);
      ((ImageView)CountActivity.this.viewApk.findViewById(2131230757)).setImageResource(2130837505);
      ((TextView)CountActivity.this.viewApk.findViewById(2131230758)).setText(2131034157);
      ((TextView)CountActivity.this.viewApk.findViewById(2131230759)).setText(FileUtil.addParentheses("  ?  "));
      ((TextView)CountActivity.this.viewApk.findViewById(2131230760)).setText("0 B");
      CountActivity.this.viewApk.findViewById(2131230756).setOnClickListener(CountActivity.this.categoryClickListener);
      if (Config.isLewaRom)
      {
        CountActivity.this.viewTheme = CountActivity.this.findViewById(2131230734);
        ((TextView)CountActivity.this.viewTheme.findViewById(2131230758)).setText(2131034225);
        ((TextView)CountActivity.this.viewTheme.findViewById(2131230759)).setText(FileUtil.addParentheses("  ?  "));
        ((TextView)CountActivity.this.viewTheme.findViewById(2131230760)).setText("0 B");
        CountActivity.this.viewTheme.findViewById(2131230756).setOnClickListener(CountActivity.this.categoryClickListener);
      }
      setSdcard(false);
      setMemory(false);
    }

    private void setMemProgress()
      throws Exception
    {
      View localView = CountActivity.this.findViewById(2131230754);
      ViewGroup.LayoutParams localLayoutParams1 = localView.getLayoutParams();
      localLayoutParams1.width = Double.valueOf(0.95D * DensityUtil.getScreenWidth(this.activity)).intValue();
      localView.setLayoutParams(localLayoutParams1);
      long l = localView.getLayoutParams().width;
      Float localFloat = Float.valueOf(1.0F - (ReadSystemMemory.getAvailableInternalMemorySize().floatValue() / ReadSystemMemory.getTotalInternalMemorySize().floatValue()));
      ViewGroup.LayoutParams localLayoutParams2 = CountActivity.this.findViewById(2131230755).getLayoutParams();
      localLayoutParams2.width = Float.valueOf(localFloat.floatValue() * (float)l).intValue();
      CountActivity.this.findViewById(2131230755).setLayoutParams(localLayoutParams2);
    }

    private void setMemory(boolean paramBoolean)
    {
      while (true)
      {
        try
        {
          ((TextView)CountActivity.this.findViewById(2131230750)).setText(CountActivity.this.getString(2131034228) + ":");
          TextView localTextView1 = (TextView)CountActivity.this.findViewById(2131230751);
          if (!(paramBoolean))
            break label156;
          str1 = ReadSystemMemory.getTotalMemoryText();
          localTextView1.setText(str1);
          ((TextView)CountActivity.this.findViewById(2131230752)).setText(CountActivity.this.getString(2131034226) + ":");
          TextView localTextView2 = (TextView)CountActivity.this.findViewById(2131230753);
          if (paramBoolean)
          {
            str2 = ReadSystemMemory.getAvailableInternalMemorySizeText();
            localTextView2.setText(str2);
            return;
          }
          String str2 = " 0 B";
        }
        catch (Exception localException)
        {
          localException.printStackTrace();
          return;
        }
        label156: String str1 = " 0 B";
      }
    }

    private void setSDProgress()
      throws Exception
    {
      Float localFloat9;
      View localView = CountActivity.this.findViewById(2131230741);
      LinearLayout.LayoutParams localLayoutParams = (LinearLayout.LayoutParams)localView.getLayoutParams();
      localLayoutParams.width = Double.valueOf(0.95D * DensityUtil.getScreenWidth(this.activity)).intValue();
      localView.setLayoutParams(localLayoutParams);
      long l = localView.getLayoutParams().width;
      if ((CountActivity.this.blockSizeMap == null) || (CountActivity.this.blockSizeMap.isEmpty()))
        CountActivity.this.blockSizeMap = FileUtil.getAvailableStore(NavigationConstants.SDCARD_PATH);
      Float localFloat1 = Float.valueOf(((Long)CountActivity.this.blockSizeMap.get("totalSize")).floatValue());
      Float localFloat2 = Float.valueOf(((Category)MimeSrc.getCategoryRepository().get("audio")).categoryInfo.length.floatValue() / localFloat1.floatValue());
      Float localFloat3 = Float.valueOf(((Category)MimeSrc.getCategoryRepository().get("image")).categoryInfo.length.floatValue() / localFloat1.floatValue());
      Float localFloat4 = Float.valueOf(((Category)MimeSrc.getCategoryRepository().get("video")).categoryInfo.length.floatValue() / localFloat1.floatValue());
      Float localFloat5 = Float.valueOf(((Category)MimeSrc.getCategoryRepository().get("doc")).categoryInfo.length.floatValue() / localFloat1.floatValue());
      Float localFloat6 = Float.valueOf(((Category)MimeSrc.getCategoryRepository().get("apk")).categoryInfo.length.floatValue() / localFloat1.floatValue());
      if (Config.isLewaRom);
      for (Float localFloat7 = Float.valueOf(((Category)MimeSrc.getCategoryRepository().get("lewa/theme")).categoryInfo.length.floatValue() / localFloat1.floatValue()); ; localFloat7 = Float.valueOf(0.0F))
      {
        Float localFloat8 = Float.valueOf(localFloat2.floatValue() + localFloat3.floatValue() + localFloat4.floatValue() + localFloat5.floatValue() + localFloat6.floatValue());
        localFloat9 = Float.valueOf(1.0F - ((float)ReadSystemMemory.getAvailableExternalMemorySize().longValue() / localFloat1.floatValue()) - localFloat8.floatValue());
        if (0.0F != localFloat8.floatValue())
          break;
        return;
      }
      ViewGroup.LayoutParams localLayoutParams1 = CountActivity.this.findViewById(2131230742).getLayoutParams();
      localLayoutParams1.width = Float.valueOf(localFloat2.floatValue() * (float)l).intValue();
      ViewGroup.LayoutParams localLayoutParams2 = CountActivity.this.findViewById(2131230743).getLayoutParams();
      localLayoutParams2.width = Float.valueOf(localFloat3.floatValue() * (float)l).intValue();
      ViewGroup.LayoutParams localLayoutParams3 = CountActivity.this.findViewById(2131230744).getLayoutParams();
      localLayoutParams3.width = Float.valueOf(localFloat4.floatValue() * (float)l).intValue();
      ViewGroup.LayoutParams localLayoutParams4 = CountActivity.this.findViewById(2131230745).getLayoutParams();
      localLayoutParams4.width = Float.valueOf(localFloat5.floatValue() * (float)l).intValue();
      ViewGroup.LayoutParams localLayoutParams5 = CountActivity.this.findViewById(2131230746).getLayoutParams();
      localLayoutParams5.width = Float.valueOf(localFloat6.floatValue() * (float)l).intValue();
      ViewGroup.LayoutParams localLayoutParams6 = CountActivity.this.findViewById(2131230747).getLayoutParams();
      localLayoutParams6.width = Float.valueOf(localFloat7.floatValue() * (float)l).intValue();
      ViewGroup.LayoutParams localLayoutParams7 = CountActivity.this.findViewById(2131230748).getLayoutParams();
      localLayoutParams7.width = Float.valueOf(localFloat9.floatValue() * (float)l).intValue();
      CountActivity.this.findViewById(2131230742).setLayoutParams(localLayoutParams1);
      CountActivity.this.findViewById(2131230743).setLayoutParams(localLayoutParams2);
      CountActivity.this.findViewById(2131230744).setLayoutParams(localLayoutParams3);
      CountActivity.this.findViewById(2131230745).setLayoutParams(localLayoutParams4);
      CountActivity.this.findViewById(2131230746).setLayoutParams(localLayoutParams5);
      CountActivity.this.findViewById(2131230747).setLayoutParams(localLayoutParams6);
      CountActivity.this.findViewById(2131230748).setLayoutParams(localLayoutParams7);
    }

    private void setSdcard(boolean paramBoolean)
    {
      String str1 = "";
      String str2 = "";
      if (paramBoolean);
      while (true)
      {
        try
        {
          HashMap localHashMap = FileUtil.getAvailableStore(NavigationConstants.SDCARD_PATH);
          str1 = localHashMap.get("availaBlocks").toString();
          str2 = localHashMap.get("totalBlocks").toString();
          ((TextView)CountActivity.this.findViewById(2131230736)).setText(CountActivity.this.getString(2131034227) + ":");
          TextView localTextView1 = (TextView)CountActivity.this.findViewById(2131230737);
          if (!(paramBoolean))
            break label196;
          localTextView1.setText(str2);
          ((TextView)CountActivity.this.findViewById(2131230738)).setText(CountActivity.this.getString(2131034226) + ":");
          TextView localTextView2 = (TextView)CountActivity.this.findViewById(2131230739);
          if (paramBoolean)
          {
            localTextView2.setText(str1);
            return;
          }
          str1 = " 0 B";
        }
        catch (Exception localException)
        {
          localException.printStackTrace();
          return;
        }
        label196: str2 = " 0 B";
      }
    }

    private void uiStatusUpdate()
    {
      if (!(CountActivity.this.atTopToSearch))
        CountActivity.this.baseSwitchSearchMain(false);
      if (CountActivity.this.scanBarToHideFlag);
      for (int i = 8; ; i = 0)
      {
        CountActivity.this.hideScanBar(i);
        return;
      }
    }

    public void dataChanged(Object[] paramArrayOfObject)
    {
    }

    public void init()
    {
      this.inited = true;
    }

    public void notifyCountData()
    {
      notifyCountData(Boolean.valueOf(true));
    }

    public void notifyCountData(Boolean paramBoolean)
    {
      try
      {
        if (paramBoolean.booleanValue())
        {
          setSdcard(true);
          setMemory(true);
          bind_2_0(CountActivity.this.findViewById(2131230728), ((Category)MimeSrc.categoryRepository.get("audio")).categoryInfo);
          bind_2_0(CountActivity.this.viewImage.findViewById(2131230730), ((Category)MimeSrc.categoryRepository.get("image")).categoryInfo);
          bind_2_0(CountActivity.this.findViewById(2131230731), ((Category)MimeSrc.categoryRepository.get("video")).categoryInfo);
          bind_2_0(CountActivity.this.findViewById(2131230732), ((Category)MimeSrc.categoryRepository.get("doc")).categoryInfo);
          bind_2_0(CountActivity.this.findViewById(2131230733), ((Category)MimeSrc.categoryRepository.get("apk")).categoryInfo);
          if (Config.isLewaRom)
            bind_2_0(CountActivity.this.findViewById(2131230734), ((Category)MimeSrc.categoryRepository.get("lewa/theme")).categoryInfo);
          setSDProgress();
          setMemProgress();
        }
        return;
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
    }

    public void rebind()
    {
      uiStatusUpdate();
      notifyCountData(Boolean.valueOf(this.inited));
    }

    public void refresh()
    {
    }

    public void start()
    {
      if (this.view == null)
      {
        this.view = LayoutInflater.from(CountActivity.this.context).inflate(2130903043, null);
        CountActivity.this.contentView = this.view;
      }
      this.activity.setContentView(this.view);
      initUI();
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     com.direction.hold.ui.CountActivity
 * JD-Core Version:    0.5.2
 */